package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.dto.TabDto;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.business.dto.response.OrderDealerPaymentBizDto;
import com.molichuxing.services.infrastructure.dto.request.create.OrderDealerDeliveryCreateDto;
import com.molichuxing.services.infrastructure.dto.request.modify.DeliverySlipModifyDto;
import com.molichuxing.services.infrastructure.dto.request.modify.OrderDealerStartStatusModifyDto;
import com.molichuxing.services.infrastructure.dto.request.modify.RefuseModifyFto;
import com.molichuxing.services.infrastructure.dto.response.OrderDealerDeliveryDto;
import com.molichuxing.services.infrastructure.dto.response.OrderDealerDetailCarInfoDto;
import com.molichuxing.services.infrastructure.dto.response.OrderDealerDetailStartDto;

import java.util.List;

/**
 * <p>
 * 经销商订单提车表 服务类
 * </p>
 *
 * @author renzhengyu
 * @since 2019-08-12
 */
public interface OrderDealerDeliveryService  extends RootService {


    /**
     * 查询订单关联车辆id
     * @param orderCode
     * @return
     */
    public List<Integer> getCarIdListByOrderCode(Long orderCode);

    /**
     * 查询订单关联车辆信息
     * @param orderCode
     * @return
     */
    public List<OrderDealerDetailCarInfoDto> getDetailCarInfoDto(Long orderCode);

    /**
     * 查询订单关联发车信息
     * @param orderCode
     * @param carStatus 1:未发车，2：拒收车，3：未收车，4：已收车
     * @return
     */
    public List<OrderDealerDetailStartDto> getDetailStartDto(Long orderCode , Integer carStatus);

    /**
     * 查询订单关联发车信息数量
     * @param orderCode
     * @return
     */
    public List<TabDto> getDetailStartCountDto(Long orderCode);

    /**
     * 修改经销商订单车辆发车状态
     * @param orderDealerStartStatusModifyDto
     * @return
     */
    public Boolean modifyCarStartStatus(OrderDealerStartStatusModifyDto orderDealerStartStatusModifyDto);


    /**
     * 车辆拒收
     * @return
     */
    public Boolean modifyCarRefuseStatus(RefuseModifyFto refuseModifyFto);


    /**
     * 查询车辆信息表
     * @param orderCode  订单号
     * @param carId     车辆id
     * @return
     */
    public OrderDealerDeliveryDto getOrderDealerDeliveryInfo(Long orderCode , Integer carId );

    /**
     * 批量新增车辆表信息
     * @param orderDealerDeliveryList
     * @return
     */
    public List<Integer> createOrderDealerDelivery(List<OrderDealerDeliveryCreateDto> orderDealerDeliveryList);

    /**
     * 修改车辆是否更换状态
     * @param orderCode
     * @param carId
     * @return
     */
    public Boolean modifyCarChangeStatus(Long orderCode , Integer carId);


    /**
     * 保存交车单-将车辆状态改为已收车
     * @return
     */
    public Boolean modifyDeliverySlip(DeliverySlipModifyDto deliverySlipModifyDto);


    /**
     * 查询订单下所有发车状态
     * @param orderCode
     * @return
     */
    public List<Integer> getSendStatusByOrderCode(Long orderCode);


    /**
     * 根据车辆id查询订单号
     * @return
     */
    public Long getOrderCodeBycarId(Integer carId);


    /**
     * 车辆id校验
     * @param carId
     * @return
     */
    public Boolean carIdCheck(Integer carId);

    /**
     * 查询订单下所有已收车的车辆信息
     * @param orderCodeList
     * @param carId
     * @return
     */
    List<OrderDealerPaymentBizDto> getOrderDealerPayment(List<Long> orderCodeList, Integer carId);


    /**
     * 解除车辆锁定状态
     * @param carId
     * @return
     */
    public Boolean modifyCarLock(Integer carId);


    /**
     * 根据车辆id查询收车时的已行驶里程
     * @param carId
     * @return
     */
    public Integer getTotalMileageByCarId(Integer carId);
}
